package com.qf.excepion;

import org.apache.shiro.authz.AuthorizationException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

/**
 * @Component
 * @Controller
 * @Service
 * @Repository
 *
 * @author 千峰教育
 * @Company http://www.mobiletrain.org/
 * @Version 1.0
 */
@ControllerAdvice
public class MyHandlerException {

    @ExceptionHandler({
            AuthorizationException.class
    })
    public String handlerAuthorizationException(AuthorizationException e){
        e.printStackTrace();
        return "unauthorizedUrl.html";
    }


    @ExceptionHandler({
            Exception.class
    })
    public String handlerException(Exception e){
        e.printStackTrace();
        return "login.html";
    }

}
